{% extends 'teacher_base.html' %}

{% block context %}
 <div class="col-sm-6 col-lg-4 mb-4" style="position: absolute;right: 35%">
      <div class="card text-center">
        <div class="card-body">
          <h5 class="card-title">添加课程</h5>
          <form action="" method="post" enctype="multipart/form-data">
            {% csrf_token %}
            <div class="form-floating">
            <input type="text" class="form-control" id="floatingInput" placeholder="课程名" name="course_name">
            <label for="floatingInput">课程名</label>
            </div>
              <p>

              </p>
              <div class="form-floating">
                  <lable>上传学生名单</lable><span></span><input type="file" name="my_file">
                  <br>
                  <a href="{% url 'teacher:downloadcsv' %}">下载上传模板</a>
              </div>

              <p>

              </p>
              {% if messages %}
        <ul style="list-style: none">
            {% for message in messages %}
                <li style="color: red">{{ message }}</li>
            {% endfor %}

        </ul>
      {% endif %}
              <button class="w-100 btn btn-lg btn-primary" type="submit">确定</button>
              </form>
        </div>
        </div>
    </div>
{% endblock %}